package com.cy.gameserver.dao.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

/**
 * Created by tiankai.qin on 18/3/29.
 */
public interface TokenMapper {

    @Insert({"insert into tb_token (uid,token,expire_time) values(#{uid},#{token},#{expireTime,typeHandler=com.cy.gameserver.dao.common.TimestampTypeHandler})"})
    void insertToken(int uid, String token,long expireTime);

    @Select("select uid from tb_token where token = #{token}")
    int selectUidByToken(String token);

    @Delete("delete from tb_token where token = #{token}")
    void delToken(String token);
}
